<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hi+海家未知旅行计划</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/api.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/aui.css" />
    <link rel="stylesheet" href="__JS__/layui/css/layui.css">
    <style>
        html,body{
          width:100%;
          height:100%;
          margin:0;
          padding:0;
          background:url(__IMAGE__/lvyou/phone_bg.png) no-repeat center center;
          background-size:cover;
        }
        body::before{
          content: '';
          display: table;
        }
        /*.phoneInput{
          width:75%;
          height:1.9rem;
          background:#54DEE7;
          border-radius:2rem;
          position:absolute;
          top:39%;
          left:12.5%;
          display: flex;
          align-items: center;
        }
        .phoneImg{
          width:0.9rem;
          height:1.1rem;
          margin-left:0.75rem;
        }
        .phoneNumber{
          font-size:0.75rem;
          color:#000;
          letter-spacing: 2px;
        }
        input[type='tel']{
          margin:0;
          padding:0;
          height:1.9rem;
          font-size:0.65rem;
          color:#000;
          background:transparent;
          outline:none;
        }
        .receive{
          width:75%;
          height:1.9rem;
          line-height:2rem;
          font-size:0.9rem;
          color:#000;
          letter-spacing: 8px;
          background:#54DEE7;
          border-radius:2rem;
          position:absolute;
          top:50%;
          left:12.5%;
          text-align:center;
        }*/
        .phone_all{
          width: 300px;
          height: 126px;
          margin: 0 auto;
          margin-top: 60%;
          background: url(__IMAGE__/lvyou/phone_input.png) no-repeat center center;
          background-size: 100% 100%;
          position: relative;
        }
        input[type='tel']{
          position: absolute;
          width: 175px;
          top: 2px;
          left: 95px;
          right: 40px;
          height: 1.9rem;
          font-size: 0.65rem;
          color:#000;
          background:transparent;
          outline:none;
        }
        .receive{
          width: 285px;
          height: 47px;
          background: transparent;
          border-radius: 2rem;
          position: absolute;
          top: 60%;
          left: 2.5%;
        }
    </style>
</head>

<body>
<div class="phone_all">
    <!-- <img src="__IMAGE__/lvyou/phone.png" alt="" class="phoneImg"> -->
    <!-- <div class="phoneNumber">手机号：</div> -->
    <input type="tel" class="phone" maxlength="11">
	<div class="receive"  id="but" tapmode="active"></div>
</div>
</body>
<script type="text/javascript" src="__JS__/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="__JS__/api.js"></script>
<script type="text/javascript" src="__JS__/layer/layer.js"></script>
<script type="text/javascript">
    apiready = function() {
        $api.css($api.dom('body'), 'width:' + api.winWidth + 'px;height:' + api.winHeight + 'px;')
    };
    //------------ip---------------
    $.ajax({
        type:'post',
        url:"http://mww1.xuanwumobile.com/home/User/wapNum",
        data:'type=7',
        dataType:'JSON',
        success:function(res){

        },
        error:function(){
		
        }
    });
    //----------end-----------------
  
    function delayer(number){
        window.location.href = "{:U('home/User/drawcode')}?number=" + number;
    }
    $(function () {
        $('#but').click(function () {
            var username = '用户';
            var phone = $('.phone').val();
            if(username == ''){
                layer.msg('用户名不能为空', {time:3000});
                return;
            }
            if(phone == ''){
                layer.msg('手机号不能为空', {time:3000});
                return;
            }
            var pregphone = /^[1][3578][0-9]{9}$/;
            if(!pregphone.test(phone)){
                layer.msg('请填写正确的11位手机号码', {time:3000});
                return;
            }
            $.ajax({
                type:'post',
                url:"{:U('home/User/userinfo')}",
                data:{username:username, phone:phone},
                dataType:'JSON',
                success:function(res){
                    if(res.status == 0){
                        layer.msg(res.msg, {time:3000});
                    }else{
                        layer.msg(res.msg, {time:3000});
                        number = res.number;
                        setTimeout("delayer(number)", 2000);
                    }
                }
            })
        })
    })
</script>

</html>
